package com.icinfo.cloud.provider.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.ObjectUtils;

/**
 * 证件类型转化行为码证件类型
 * @author liyafeng
 * @date 2022/11/12
 */
@AllArgsConstructor
public enum CardTypeTransEnum {

    /**
     * 证件类型枚举
     */
    PUNISH_TYPE_SFZ("SFZ", "111"),
    PUNISH_TYPE_HKB("HKB", "113"),
    PUNISH_TYPE_JRSFZ("JRSFZ", "114"),
    PUNISH_TYPE_WZJCSFZ("WZJCSFZ", "115"),
    PUNISH_TYPE_WGRSFZ("WGRSFZ", "154"),
    PUNISH_TYPE_HZ("HZ", "414"),
    PUNISH_TYPE_TWJM("TWJM", "511"),
    PUNISH_TYPE_GAJM("GAJM", "516");

    /**
     * 编码
     */
    @Getter
    private String pubishType;
    /**
     * 描述
     */
    @Getter
    private String actCodeType;

    /**
     * 描述：根据pubishType获取actCodeType
     *
     * @param pubishType 编码
     * @return 描述内容
     * @author xiangyuyu
     * @date 2022-02-22 10:43
     */
    public static String getValueByCode(String pubishType) {
        if (ObjectUtils.isEmpty(pubishType)) {
            return null;
        }
        for (CardTypeTransEnum e : CardTypeTransEnum.values()) {
            if (pubishType.equals(e.getPubishType())) {
                return e.getActCodeType();
            }
        }
        return null;
    }

}
